package com.wuyangnju.healthclub.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;

import com.wuyangnju.healthclub.service.FinancialService;

@Controller
public class FinancialController {

	@Resource
	FinancialService financialService;

	@RequestMapping(value = { "/financial/single.do" })
	public ModelAndView put1(@RequestParam String cardId,
			@RequestParam double charge) {
		financialService.singleCharge(cardId, charge);
		return new ModelAndView(new RedirectView("/resource/singles.get", true));
	}

	@RequestMapping(value = { "/financial/family.do" })
	public ModelAndView put2(@RequestParam String cardId,
			@RequestParam double charge) {
		financialService.familyCharge(cardId, charge);
		return new ModelAndView(
				new RedirectView("/resource/families.get", true));
	}

}
